<!DOCTYPE html>
<html>


<!-- Mirrored from www.zi-han.net/theme/hplus/form_validate.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:19:15 GMT -->
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>添加商品</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="favicon.ico"> <link href="__PUBLIC__/admin/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/animate.min.css" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/css/plugins/simditor/simditor.css" />
    <link href="__PUBLIC__/admin/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <link rel="stylesheet" href="__PUBLIC__/admin/js/kindeditor/themes/default/default.css" />
    <link href="__PUBLIC__/admin/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">

</head>
<style type="text/css">
    .inp{
        width: 200px;
    }
</style>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-6" style="width: 100%;">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>编辑品牌</h5>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                            <a class="dropdown-toggle" data-toggle="dropdown" href="form_basic.html#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a href="form_basic.html#">选项1</a>
                                </li>
                                <li><a href="form_basic.html#">选项2</a>
                                </li>
                            </ul>
                            <a class="close-link">
                                <i class="fa fa-times"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <form class="form-horizontal m-t" id="signupForm" method="post" action="{:U('/shop/brank_add')}" enctype="multipart/form-data" >
                            <div class="form-group">
                                <label class="col-sm-3 control-label">品牌名称：</label>
                                <div class="col-sm-8">
                                    <input id="firstname" name="arr[name]" class="form-control inp" type="text" value="{$brank['name']}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">品牌网站：</label>
                                <div class="col-sm-8">
                                    <input id="lastname" name="arr[url]" class="form-control inp" type="text" value="{$brank['url']}" >
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">所属分类：</label>

                                <div class="col-sm-8">
                                    <select style="width: 150px;float: left;margin-right : 20px;" name="arr[cat_id]" class="form-control m-b" onchange="brank(this)">
                                        <option value="">请选择商品分类</option>
                                        <foreach name="nav" item="val">
                                            <option value="{$val['id']}" <if condition="$val['id'] eq $brank['id']">selected</if> >{$val['name']}</option>
                                        </foreach>
                                    </select>
                                    <select style="width: 150px;float: left;margin-right : 20px;" name="arr[parent_cat_id]" class="form-control m-b">
                                        <option value="">请选择商品分类</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">图片上传：</label>

                                <div class="col-sm-8">
                                    <img src="{$brank['logo']}" alt="logo">
                                    <input id="username" name="logo" class="form-control inp" type="file" aria-required="true" aria-invalid="true" class="error">
                                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 请上传图片格式文件</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">排序：</label>

                                <div class="col-sm-8">
                                    <input id="username" name="arr[order]" class="form-control inp" type="text" value="{$brank['order']}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">品牌描述：</label>

                                <div class="col-sm-8">
                                    <textarea id="ccomment" name="arr[desc]" class="form-control inp" required="" aria-required="true">{$brank['desc']}</textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-8 col-sm-offset-3">
                                    <button class="btn btn-primary" type="submit">提交</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="__PUBLIC__/admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="__PUBLIC__/admin/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="__PUBLIC__/admin/js/content.min.js?v=1.0.0"></script>
    <script src="__PUBLIC__/admin/js/plugins/iCheck/icheck.min.js"></script>
    <script charset="utf-8" src="__PUBLIC__/admin/js/kindeditor/kindeditor-min.js"></script>
    <script charset="utf-8" src="__PUBLIC__/admin/js/kindeditor/lang/zh_CN.js"></script>
    <script src="__PUBLIC__/admin/js/plugins/sweetalert/sweetalert.min.js"></script>
    <script>
        $(document).ready(function(){$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})});
    </script>

    <script>
    function brank(e){
        var id = e.value;
        console.log(id);
        console.log(e);
        $.ajax({
            type: 'POST',
            url: "{:U('/shop/brank')}",
            data: {id:id},
            dataType: 'json',
            success: function(data){
                console.log(data);
                var str = '';
                for(i in data){
                    str += '<option value="'+data[i].id+'">'+data[i].name+'</option>';
                }
                console.log(str);
                $(e).next().append(str);
            },
            error:function(data) {

            },
        })
    }

    function brank_list(e) {
        var id = e.value;
        console.log(id);
        console.log(e);
        $.ajax({
            type: 'POST',
            url: "{:U('/shop/brank_list')}",
            data: {id:id},
            dataType: 'json',
            success: function(data){
                console.log(data);
                var str = '';
                for(i in data){
                    str += '<option value="'+data[i].id+'">'+data[i].name+'</option>';
                }
                console.log(str);
                $(e).next().append(str);
            },
            error:function(data) {

            },
        })
    }
    
             var editor;
             KindEditor.ready(function(K) {
                 editor = K.create('textarea[name="article_desc"]', {
                     allowFileManager : true
                 });
             });
             var editor1;
             KindEditor.ready(function(K) {
                 editor1 = K.create('textarea[name="content"]', {
                     allowFileManager : true
                 });
             });
        $(document).ready(function(){$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})});
      $('#loading-example-btn').click(function(){
        location.reload();
       })
    </script>

    <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
</body>


</html>
